import { createRouter, createWebHistory } from 'vue-router'
import HistoryView from '../views/HistoryView.vue'
import ChatView from '../views/ChatView.vue'
import Favorite from '../views/Favorite.vue'
import FavoriteView from '../views/FavoriteView.vue'
import Home from '../views/Home.vue'
import QuestionAnswerView from '../views/QuestionAnswerView.vue'
import LoginPage from '../views/LoginPage.vue'
import KnowledgeBase from '../views/knowledgeBase.vue'
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'
// import { setup } from "../utils/permissions"

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path:"/login",
    name:"login",
    component:LoginPage
  },
  {
    path: '/home',
    name: 'home',
    component: Home
  },
  {
    path: '/history',
    name: 'history',
    component: HistoryView
  },
  {
    path: '/chat',
    name: 'chat',
    component: ChatView
  },
  {
    path: '/favorite',
    name: 'favorite',
    component: Favorite
  },
  {
    path: '/favoritedes',
    name: 'favoritedes',
    component: FavoriteView
  },
  {
    path: '/qa',
    name: 'questionAnswer',
    component: QuestionAnswerView
  },
  {
    path: '/knowledgeBase',
    name: 'knowledgeBase',
    component: KnowledgeBase
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})


export default router 